
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<span style="font-size:18px;">
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="attendance/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="attendance/css/commonly-used-show.css" />
    <script type="text/javascript" src="attendance/js/jquery.min.js"></script>
    <script type="text/javascript" src="attendance/js/bootstrap.js" ></script>

    <title>修改考勤</title>

</head>

<body class="mybody">

 <jsp:include page="theTopMenuTeacher.jsp" />




 <div class="container-fluid">
    <div class="row">

        <div class="col-md-12">
            <div class="col-md-12">
                    <div class="panel panel-primary">
                        <div class="panel-body">
                            <div class="alert alert-success">


                                <div>
        <h3 style="text-align: center">修改考勤信息</h3>
        <hr style="filter: alpha(opacity=100,finishopacity=0,style=3)" width="100%" color="#6f5999" size="3"/>

        <div id="personal_user" style="margin-left: 80px">

            <div class="form-group same-line">
                <label ><b style="color: red">*&nbsp</b>姓名：</label>
                <label id="user_name" class="form-control edit"></label>
            </div>

            <div class="form-group same-line-left">
                <label ><b style="color: red">*&nbsp</b>上课签到时间：</label>
                <label id="attend_time" class="form-control edit"></label>
            </div>

            <div class="form-group same-line-left">
                <label ><b style="color: red">*&nbsp</b>下课签到时间：</label>
                <label id="finish_time" class="form-control edit"></label>
            </div>

            <div class="form-group same-line">
                <label ><b style="color: red">*&nbsp</b>上课签到状态：</label>
                <select id="attend_state" style="font-size: 16px" class="form-control edit" title="请选择" data-live-search="true">
                    <option value="" disabled selected hidden>请选择</option>
                    <option value="1">正常</option>
                    <option value="2">迟到</option>
                    <option value="3">请假</option>
                    <option value="4">请假</option>
                    <option value="5">缺卡</option>
                </select>
            </div>


            <div class="form-group same-line-left">
                <label ><b style="color: red">*&nbsp</b>下课签到状态：</label>
                <select id="finish_state" style="font-size: 16px" class="form-control edit" title="请选择" data-live-search="true" >
                    <option value="" disabled selected hidden>请选择</option>
                    <option value="1">正常</option>
                    <option value="2">迟到</option>
                    <option value="3">请假</option>
                    <option value="4">请假</option>
                    <option value="5">缺卡</option>
                </select>
            </div>


            <div class="form-group same-line-left">
                <label ><b style="color: red">*&nbsp</b>提交时间：</label>
                <label id="refer_time" class="form-control edit"></label>
            </div>




        </div>


        <div class="text-center same-line-clear">
            <div class="form-group">
                <input type="button" value="确认修改" class="btn btn-primary" onclick="present()" >
                <input type="reset" value="重置" class="btn btn-danger interval" onclick="reset()">
            </div>

            <div>
                <label id="user_null" style="color: red"></label>
            </div>
        </div>

    </div>


                            </div>
                        </div>
                    </div>
                </div>
        </div>



    </div>

 </div>


<script type="text/javascript">
    var userdt = JSON.parse(sessionStorage.getItem("user"));
    if (userdt.result.userName != null){
        $("#usname").text(userdt.result.userName);
    }else {
        $("#usname").text(userdt.result.userLoginName);
    }


    window.onload = function(){
        checkInfo();
    }


    function checkInfo(){

        var postUrl = "${pageContext.request.contextPath}/member/queryDayAttendanceRecord";
        var str = {
            "id": "${param.id}"
        };

        $.ajax({
            type:"post",
            url:postUrl,
            headers: {
                "Content-Type":"application/json"
            },
            data:JSON.stringify(str),
            contentType: "application/json; charset=utf-8",
            dataType:"json",
            success:function(data){
                if (data.status == "0"){
                    userNull.innerHTML = data.msg;
                }else {
                    $("#user_name").text(data.result.userName);
                    $("#attend_time").text(data.result.startAttendDate + " " + data.result.startAttendTime);
                    if(data.result.endAttendDate != null){
                        $("#finish_time").text(data.result.endAttendDate + " " + data.result.endAttendTime);
                    }else {
                        $("#finish_time").text("未到时间");
                    }

                    $("#attend_state").val(data.result.startAttendState);
                    $("#finish_state").val(data.result.endAttendState);
                    $("#refer_time").text(data.result.createTime);


                }

            },
            error:function(xhr,state,errorThrown){
                //alert("发生网络错误，错误码为：" + xhr.status)
                location.href = "${pageContext.request.contextPath}/error";
            }
        });
    }

</script>

</body>
</html>
</span>